/*
 *  Piece.h
 *
 *	Abstract Piece Class, defines absract and non-abstract methods for pieces. Extended by King,Queen,Bishop,Knight,Rook, and Pawn
 */

#ifndef PIECE_H_
#define PIECE_H_

#include "Position.h"
#include <vector>

#define BOARDSIZE 8

using namespace std;

enum Color{WHITE,BLACK};	//Enumeration to distinguish Piece's owner
enum PieceType{KING,QUEEN,BISHOP,KNIGHT,ROOK,PAWN};	//Enumeration to distinguish Piece's type


class Piece{
protected:
	Color color;		//Defines Piece Color
	PieceType type;		//Defines what type of piece it is
	Position pos;		//Defines location of piece
	bool alive;			//Specifies whether piece is still in the game (a dead piece still thinks it's on the board)
public:
	//Constructor
	Piece(Color _color,Position _pos, PieceType _type): color(_color),type(_type),pos(_pos){
		alive=true;
	}
	~Piece(){								//Deconstructor
		return;
	}
	virtual vector<Position> getPotentialMoves()=0; //Abstract method that returns moves that may be possible for the piece

	void setPos(Position newPos){ 	//Changes piece's position
		pos=newPos;
	}
	Position getPosition(){ 	//Changes piece's position
		return pos;
	}
	Color getColor(){ 				//Returns Piece's color
		return color;
	}
	PieceType getType(){ 			//Returns Piece's type
		return type;
	}
	bool isAlive(){					//Returns whether piece is alive
		return alive;
	}
	void kill(){					//Sets piece as "dead"
		alive=false;
	}
	void unKill(){					//Sets piece as "alive"
		alive=true;
	}

};

#endif /* PIECE_H_ */
